#!/bin/bash

#------------------------------------------------------------------------------
#Filename:	74711-namelength.sh
#Version:	1.1
#Date:	        2013/07/11
#Author:	yuanhui.shi
#Email:	        yuanhui.shi@cs2c.com.cn
#Summary:	02.01系统核心功能-01文件系统-01文件命名-02验证文件名称的字符长度在不长于256时可以正常命名
#Notes:	        验证文件名长度
#Copyright:	China Standard Software Co.,Ltd.
#History:
#	        Version 1.0,2013/07/11
#	        -The first one
#	        Version 1.1,2013/09/03
#	        -Modify the script to satisfy the shell standard
#------------------------------------------------------------------------------


PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

source ../../lib/Echo.sh

function CleanData ()
{
 cd ..
 rm -rf test
 EchoInfo "74711-namelength.sh执行完毕"
}

trap "CleanData" EXIT

mkdir test
cd test

touch  abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu

EchoResult "新建英文字符长度为255个的文件成功" 


touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuw &>/dev/null

test "`echo $?`" != 0 
EchoResult "新建英文字符长度为256个的文件失败" 


touch  一二三四五六七八九十一二三四五六七八九十一二三四五 六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五

EchoResult "新建中文字符长度为85个的文件成功" 


touch 一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六 &>/dev/null

test "`echo $?`" != 0 
EchoResult "新建中文字符长度为86个的文件失败" 

